package com.samehope.ar.mapper;

import com.samehope.ar.entity.PatrolRoute;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.samehope.ar.vo.RouteDetailVO;
import com.samehope.ar.vo.TreeDataVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 巡检路线 Mapper 接口
 * </p>
 *
 * @author Zhang Luo
 * @since 2019-12-23
 */
public interface PatrolRouteMapper extends BaseMapper<PatrolRoute> {

    /**
     * 查询线路树结构
     * @param projectId
     * @param condition
     * @return
     */
    List<TreeDataVO> getRouteTreeByProjectAndCondition(@Param("projectId") Long projectId,
                                                       @Param("condition") String condition);

    /**
     * 根据项目和ID查询线路
     * @param projectId
     * @param routeId
     * @return
     */
    PatrolRoute findByProjectAndRoute(@Param("projectId") Long projectId,
                                      @Param("routeId") Long routeId);

    /**
     * 根据项目和名称查找线路
     * @param projectId
     * @param routeName
     * @return
     */
    PatrolRoute findByProjectAndName(@Param("projectId") Long projectId,
                                     @Param("routeName") String routeName);

    /**
     * 线路详情
     * @param projectId
     * @param routeId
     * @return
     */
    RouteDetailVO detailByProjectAndRoute(@Param("projectId") Long projectId,
                                          @Param("routeId") Long routeId);
}
